1. Field of the Invention
The present invention relates to the use of secondary storage devices, such as disk drives, in computer systems. More specifically, the present invention relates to a method and an apparatus for facilitating validation of data retrieved from a secondary storage device to ensure that data retrieved from the secondary storage device matches data that was originally stored to secondary storage.
2. Related Art
Advances in disk drive technology have dramatically increased the amount of data that can be stored on disk and have increased the rate at which data can be transferred to and from a disk. As data is packed more densely on disk drives and is transferred at faster rates, it becomes increasingly more likely for errors to occur. Hence, there is an increasing need to confirm the integrity of data retrieved from a disk to ensure that it is the same as data that was originally stored on the disk.
In order to confirm data integrity, computer system often compute a checksum, which is a function of a block of data to be stored on a disk drive. This checksum is stored along with the block of data on the disk drive. When the block of data is later retrieved from the disk, a new checksum is computed from the retrieved data and this new checksum is compared with the checksum that was stored with the data. If these checksums match, there is an extremely high probability that the data has not changed from its original value. If the checksums do not match, either the data or the checksum has changed.
One problem in using checksums is that the checksums require additional storage space on the disk drive. Hence, in order to store checksums along with disk blocks, the size of the disk blocks must be increased. For example, the size of a disk sector may have to be increased from 512 bytes to 516 bytes to accommodate four additional bytes of checksum information. This method works well. However, it requires the disk to be specially formatted to accommodate the checksums. Hence, it is not possible to add checksums to existing data stored on a normally formatted disk drive because the size increase causes the data to no longer fit in the original disk sector. Furthermore, when adding checksums to existing data, it is undesirable to dump out and restore the existing data in order to accommodate a new disk block format that includes space for checksum information.
It is possible to store the checksum data to another disk drive. However, if a system failure occurs during a write operation, there is no way of telling whether both the data and the checksum were written. If a system failure causes the checksum and the data to get out-of-synch, a false negative can be generated, which causes an error to be reported on good data.
What is needed is a method and an apparatus for providing validation information for disk blocks without the above-described problems.